<?php

declare (strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
namespace App\Model;

class TopConfig extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected ?string $table = 'top_config';
    public function manager()
    {
        return $this->belongsTo(Manager::class, 'manager_id');
    }
    /**
     * 根据天数查找
     * @param $days
     * @return \Hyperf\Database\Model\Builder|\Hyperf\Database\Model\Model|object|null
     */
    public static function getByDays($days)
    {
        return static::query()->where('top_days', $days)->first();
    }
}